<?php
namespace app\admin\builder;
use app\admin\builder\src\Form;
use app\admin\builder\src\Tables;

class MBuilder
{
    protected $message = '';
    //获取错误信息
    public function getMessage(){
        return $this->message;
    }

    /**创建类
     * @param string $type
     * @return Form|Tables
     */
    public static function make(string $type = 'form'){
        if($type=='form'){
            return new Form();
        }else{
            return new Tables();
        }
    }

    /**加载页面
     * @param string $emplate
     * @return \think\response\View
     */
    public function fetch(string $emplate=''){
        return view($emplate);
    }
}